<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<t:template>

<script>			
		$(function() {			
			
			$('#choferList').jqGrid({
				url:'chofer?action=getForGrid&entity=chofer&filterValue='+$('#id').val(),
				datatype: 'json',
				colNames:['Id', 'Nombre', 'Apellido', 'Licencia', 'Patente'],
				colModel :[
					{name:'id', index:'id', width:55},
					{name:'nombre', index:'nombre', width:100 , searchoptions: { sopt: ['eq', 'bw', 'ew'] }},
					{name:'apellido', index:'apellido', width:100 , searchoptions: { sopt: ['eq', 'bw', 'ew'] }},
					{name:'licencia', index:'licencia', width:100 , searchoptions: { sopt: ['eq', 'bw', 'ew'] }},
					{name:'patente', index:'patente', width:100 , searchoptions: { sopt: ['eq', 'bw', 'ew'] }}
				],
				pager: '#choferPager',
				height: 150,
				width: 700,
				rowNum:100,
				rowList:[100,150,200],
				sortname: 'id',
				sortorder: 'asc',
				viewrecords: true,
				gridview: true,
				caption: 'Choferes',
				ondblClickRow: function(id){
					if(id) {
						$.colorbox({iframe:true, 
							href:'chofer?entity=chofer&action=barrios&id='+id, 
							width:700, 
							height:450, 
							overlayClose:false,
							opacity: 0.2, 
							onClosed: function() {
											
										}
							});
	  				}
				}
			});

// 			makeNavigatorCrud(	'notaryPersonList',
// 								'notaryPersonPager',
// 								'generalEditor?entity=notaryPerson&action=new&notaryId='+$('#id').val(),
// 								500,
// 								550,
// 								'notaryPerson');

		});
	</script>
	
<form name="formMain" id="formMain" method="post" action="chofer?action=guardar">
	
		<div class="container_14" style="margin-left: 0px;">
	
			<div class="grid_7 alpha box">
				<div class="grid_3 alpha">
					Nombre
				</div>
				<div class="grid_4 omega">
					<input type="text" name="nombre" id="nombre" value="${entity.nombre}" class="text"  maxlength="128"><br>
				</div>
				
				<div class="grid_3 alpha">
					Apellido
				</div>
				<div class="grid_4 omega">
					<input type="text" name="apellido" id="apellido" value="${entity.apellido}" class="text"  maxlength="124"><br>
				</div>
				
				<div class="grid_3 alpha">
					Nro licencia
				</div>
				<div class="grid_4 omega">
					<input type="text" name="licencia" id="licencia" value="${entity.licencia}" class="text"  maxlength="124"><br>
				</div>
				
				<div class="grid_3 alpha">
					Patente
				</div>
				<div class="grid_4 omega">
					<input type="text" name="patente" id="patente" value="${entity.patente}" class="text"  maxlength="124"><br>
				</div>
				<div class="grid_3 alpha">
					Marca
				</div>
				<div class="grid_4 omega">
					<input type="text" name="marca" id="marca" value="${entity.marca}" class="text"  maxlength="124"><br>
				</div>
				
			</div>
			
			<div class="grid_7 omega box">
				<div class="grid_3 alpha">
					Usuario
				</div>
				<div class="grid_4 omega">
					<input type="text" name="usuario" id="usuario" value="${entity.usuario!=null ? entity.usuario : ''}" class="text"  maxlength="124"><br>
				</div>
				<div class="grid_3 alpha">
					Password
				</div>
				<div class="grid_4 omega">
					<input type="password" name="password" id="password" value="${entity.password}" class="text"  maxlength="124"><br>
				</div>
			</div>
			
		</div>
		
		<input type="hidden" name="id" id="id" value="${entity.id}">
		<input type="hidden" name="entity" id="entity" value="chofer">

		<div class="buttonsContainer">
		
			<input type="submit" name="save" id="save" value="Gurdar">
			<input type="button" name="cancel" id="cancel" value="Cancel">			
		</div>
							
	</form>	
	
	<div class="grid_10 alpha omega">
		<table id="choferList"><tr><td/></tr></table>
		<div id="choferPager"></div>
	</div>

</t:template>